﻿using Caliburn.Micro;
using Wulong.Phone.Utils;

namespace Wulong.Phone.Qiushi.ViewModels
{
    public enum LangSupported
    {
        Auto,
        Chinese,
        English
    }

    public class SettingsViewModel : Screen
    {
        public SettingsViewModel()
        {
            int saveLang;
            _selectedIndex = (AppSettings.TryGetSetting("Lang", out saveLang)
                ? saveLang
                : 0);
        }
        private int _selectedIndex;
        public int SelectedIndex { 
            get { return _selectedIndex; }
            set 
            {
                _selectedIndex = value;
                NotifyOfPropertyChange(() => SelectedIndex);
            } 
        }

        public void SaveLangSetting(int selectedIndex)
        {
            AppSettings.StoreSetting("Lang", selectedIndex);
        }
    }
}
